package cn.cangfei.massage.exception;

import cn.cangfei.massage.common.api.CommonResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalHandler {

    // 处理自定义异常
    @ExceptionHandler(YyghException.class)
    public CommonResult handleYyghException(YyghException e) {
        return CommonResult.failed(e.getMessage());
    }
    // 处理其他异常

}
